package com.springBootStudy.mybatis.oneToMany.mapper;

import com.springBootStudy.mybatis.oneToMany.pojo.Dept;
import com.springBootStudy.mybatis.oneToMany.pojo.Staff;
import org.apache.ibatis.annotations.*;

import java.util.List;

@Mapper
public interface StaffMapper {

    //xml方式
    public List<Staff> findDeptOneToManyStaff();


    //注解方式
    @Select("select * from mybatis_staff")
    @Results(
        id = "staffMap",
        value = {
                @Result(property = "staffNo",column = "staff_no"),
                @Result(property = "deptNo",column = "dept_no",id = true),
                @Result(property = "staffName",column = "staff_name"),
                @Result(property = "isValid",column = "is_valid")
        }
    )
    public List<Staff> annotionDeptStaff();


}
